<?php 
  require_once('nav.php');
 ?>
    <div class="col-sm-9 col-md-10">
      <?php 
       $sql = 'select * from videos';
       $result = fetch_array($sql); 
       ?>
    <center><h3>视频列表</h3></center>
 <table class="table table-hover">
 <thead class="text-center">
    <tr>
   <th class="text-center">用户编号</th>
   <th class="text-center">视频名称</th>   
   <th class="text-center">视频类型</th>
   <th class="text-center">海报</th>
   <th class="text-center" width="150" >内容简介</th>
   <th class="text-center">添加日期</th>
   <th class="text-center">上传用户</th> 
   <th class="text-center">点击率</th> 
   <th class="text-center">下载量</th> 
   <th class="text-center">下载地址</th> 
   <th class="text-center">操作</th> 
 </tr>
 </thead>

 <?php
  foreach ($result as $row) {
   echo '<tr class="text-center">';
   echo '<td>'.$row['vid'].'</td>';
   echo '<td>'.$row['videoname'].'</td>';  
   echo '<td>'.$row['tid'].'</td>';
   echo '<td align="center"><img src="images/'.$row['pic'].'" width=60 height=80 alt="无头像"></td>';   
   echo '<td>'.$row['intro'].'</td>'; 
   echo '<td>'.$row['uploaddate'].'</td>';
   echo '<td>'.$row['uploadadmin'].'</td>';
   echo '<td>'.$row['hittimes'].'</td>';
   echo '<td>'.$row['downtimes'].'</td>';
   echo '<td>'.$row['address'].'</td>';
   echo '<td><a href="videoEdit-Form.php?id='.$row['vid'].' ">修改</a> | 
   <a href="videoDelete.php?id='.$row['vid'].'" onClick="return confirm(\'确定要删除吗？\');">删除</a></td>';
   echo '</tr>';  
  }
  echo '</table>';  
  $totalrows = count($result);
  echo "<table align='center'><tr><td>共有{$totalrows}名用户</td></tr></table>";  
 ?>

    </div>
    <?php 
      require_once('footer.php');
     ?>
 
   